package com.wenbo.wenbo.controller;

import cn.hutool.core.util.StrUtil;
import com.wenbo.wenbo.dto.StoryDto;
import com.wenbo.wenbo.service.PoetryService;
import com.wenbo.wenbo.service.StoryService;
import com.wenbo.wenbo.utils.ResultObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ywb
 * @date 2021年12月08日 9:57
 */
@RestController
@RequestMapping("/api/poetry")
public class PoetryController {

    @Resource
    private PoetryService poetryService;


//    @GetMapping("/getStory")
//    public ResultObject<StoryDto> getStory(String name, String type) {
//        if (StrUtil.isBlankIfStr(type)) {
//            type = "3";
//        }
//        List<StoryDto> list = storyService.getStory(name, type);
//        return ResultObject.ok("查询成功").setData(list);
//    }
//
//    @GetMapping("/getStoryInfo")
//    public ResultObject<StoryDto> getStoryInfo(String id) {
//        StoryDto info = storyService.getStoryInfo(id);
//        return ResultObject.ok("查询成功").setData(info);
//    }

    @GetMapping("/getPoetryList")
    public ResultObject<Void> getPoetryList() throws InterruptedException {
        poetryService.getPoetryList();
        return ResultObject.ok("查询成功");
    }

}
